package com.android.monee.domain;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import com.android.monee.data.model.Mensuality;

public class PausedMensCalculator implements MensualityCalculator {

	private BudgetService budget;
	
	public PausedMensCalculator(BudgetService budget){
		this.budget = budget;
	}
	
	@Override
	public List<Mensuality> calcUndoneMensualities() {
		List<Mensuality> nextMensualities = new ArrayList<Mensuality>();
		
		Set<Integer> nextMensNumbers = budget.getUndoneMensNumbers();
		
		for(Integer i : nextMensNumbers){
			float mensAmount = 0;			
			
			Mensuality mens = new Mensuality(budget);
			mens.setBudgetId(budget.getId());
			mens.setNumber(i);
			mens.setAmount(mensAmount);
			mens.setDate(budget.getDateForMensuality(mens.getNumber()));
			
			nextMensualities.add(mens);
		}
		
		return nextMensualities;
	}

}
